﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using System.Data;
using System.Data.Odbc;
using Sweat.Service;

public partial class Vakken : System.Web.UI.Page
{
    VakService service = new VakService();
    protected void Page_Load(object sender, EventArgs e)
    {
        List<VakDTO> vakken = service.ReadAllVakkenFromStudent((int)Session["studentid"]);
        //List<VakDTO> vakken = service.readAll();
        if (vakken.Count > 0)
        {
            ddlVakken.DataSource = vakken;
            ddlVakken.DataTextField = "vakNaam";
            ddlVakken.DataValueField = "vakid";
            ddlVakken.DataBind();
            ddlVakken.Items.Insert(0, new ListItem("--Kies een vak--", "0"));
            
            
        }
        else
        {
            ddlVakken.Items.Insert(0,new ListItem("--Geen vakken beschikbaar!--","0"));
        }

        
        
    }
    protected void ddlVakken_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
}
